package com.ys;

/**
 * @program: note
 * @description:
 * @author:
 * @create 2020-06-11 22:51
 **/
public abstract class CommandBase implements Command {
    protected ConsumeRecordController consumeRecordController;
    protected String[] input;

    public CommandBase(ConsumeRecordController consumeRecordController, String[] input) {
        this.consumeRecordController = consumeRecordController;
        this.input = input;
    }

    @Override
    public void execute() {
        try {
            doExecute();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("输入命令有误, 请重新输入!");
        }
    }

    public abstract void doExecute();

}
